package de.klingbeil.hhc.client;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;

public class GridFactory {

	public static <M extends ModelData> Grid<M> createGrid(ListStore<M> store,
			ColumnModel cm) {
		Grid<M> result = new Grid<M>(store, cm);
		setGridProperties(result);
		return result;
	}

	private static <M extends ModelData> void setGridProperties(Grid<M> result) {
		result.getView().setForceFit(true);
		result.getView().setShowDirtyCells(false);
		result.setStripeRows(true);
	}
}
